<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LogIn</title>
</head>
<link rel="stylesheet" href="css/log.css">
<script>
    
    function checkUser() {
        var name = document.forms["LogInForm"]["username"].value;
        var pwd = document.forms["LogInForm"]["pwd"].value;
        var again = document.forms["LogInForm"]["pwdagain"].value;
        if(!name) {
            alert("用户名不能为空～");
            return false;
        } 
        if(!pwd){
            alert("密码不能为空～");
            return false;
        }
        if(pwd != again){
            alert("两次输入密码不一样");
            return false;
        }
        document.getElementById("LogInForm").submit();
    }
</script>

<body>
    <div>
        <form id="LogInForm" method="get" action="regist.html">
            <div>
                <h3>注 册</h3>
                <p>
                    用户名 &nbsp; : <input type="text" id="username" name="name">
                </p>
                <p>
                    密 &nbsp; 码 &nbsp; : <input type="password" id="pwd" name="pwd">
                </p>
                <p>
                    重复输入: <input type="password" id="pwdagain">
                </p>
                <p>
                    <input type="button" value="注  册" onclick="checkUser();">
                    &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp;
                    <a href="loggin.html">已注册->登陆</a>
                </p>
            </div>
        </form>
    </div>

</body>

</html>